﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:43:06
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.Shop
{
	/// <summary>
	/// 订单项
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("订单项")]
	[BindTable("OrderItem", Description = "订单项", ConnName = "Shop", DbType = DatabaseType.SqlServer)]
	public partial class OrderItem
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "编号", "", "int", 10, 0, false)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private Int32 _OrderID;
		/// <summary>
		/// 订单编号
		/// </summary>
		[Description("订单编号")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "OrderID", "订单编号", "", "int", 10, 0, false)]
		public Int32 OrderID
		{
			get { return _OrderID; }
			set { if (OnPropertyChange("OrderID", value)) _OrderID = value; }
		}

		private Int32 _GoodsID;
		/// <summary>
		/// 商品编号
		/// </summary>
		[Description("商品编号")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(3, "GoodsID", "商品编号", "", "int", 10, 0, false)]
		public Int32 GoodsID
		{
			get { return _GoodsID; }
			set { if (OnPropertyChange("GoodsID", value)) _GoodsID = value; }
		}

		private Int32 _SiteID;
		/// <summary>
		/// 站点编号
		/// </summary>
		[Description("站点编号")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(4, "SiteID", "站点编号", "", "int", 10, 0, false)]
		public Int32 SiteID
		{
			get { return _SiteID; }
			set { if (OnPropertyChange("SiteID", value)) _SiteID = value; }
		}

		private String _UserName;
		/// <summary>
		/// 用户名称
		/// </summary>
		[Description("用户名称")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(5, "UserName", "用户名称", "", "nvarchar(200)", 0, 0, true)]
		public String UserName
		{
			get { return _UserName; }
			set { if (OnPropertyChange("UserName", value)) _UserName = value; }
		}

		private String _SN;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(6, "SN", "", "", "nvarchar(50)", 0, 0, true)]
		public String SN
		{
			get { return _SN; }
			set { if (OnPropertyChange("SN", value)) _SN = value; }
		}

		private String _Name;
		/// <summary>
		/// 名称
		/// </summary>
		[Description("名称")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(7, "Name", "名称", "", "nvarchar(200)", 0, 0, true)]
		public String Name
		{
			get { return _Name; }
			set { if (OnPropertyChange("Name", value)) _Name = value; }
		}

		private Single _Price;
		/// <summary>
		/// 价格
		/// </summary>
		[Description("价格")]
		[DataObjectField(false, false, true, 24)]
		[BindColumn(8, "Price", "价格", "", "real", 24, 0, false)]
		public Single Price
		{
			get { return _Price; }
			set { if (OnPropertyChange("Price", value)) _Price = value; }
		}

		private Single _Discount;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, true, 24)]
		[BindColumn(9, "Discount", "", "", "real", 24, 0, false)]
		public Single Discount
		{
			get { return _Discount; }
			set { if (OnPropertyChange("Discount", value)) _Discount = value; }
		}

		private Single _DiscountPrice;
		/// <summary>
		/// 价格
		/// </summary>
		[Description("价格")]
		[DataObjectField(false, false, true, 24)]
		[BindColumn(10, "DiscountPrice", "价格", "", "real", 24, 0, false)]
		public Single DiscountPrice
		{
			get { return _DiscountPrice; }
			set { if (OnPropertyChange("DiscountPrice", value)) _DiscountPrice = value; }
		}

		private Int32 _Count;
		/// <summary>
		/// 数量
		/// </summary>
		[Description("数量")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(11, "Count", "数量", "", "int", 10, 0, false)]
		public Int32 Count
		{
			get { return _Count; }
			set { if (OnPropertyChange("Count", value)) _Count = value; }
		}

		private Single _Amount;
		/// <summary>
		/// 数量
		/// </summary>
		[Description("数量")]
		[DataObjectField(false, false, true, 24)]
		[BindColumn(12, "Amount", "数量", "", "real", 24, 0, false)]
		public Single Amount
		{
			get { return _Amount; }
			set { if (OnPropertyChange("Amount", value)) _Amount = value; }
		}

		private Int32 _Score;
		/// <summary>
		/// 分数
		/// </summary>
		[Description("分数")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(13, "Score", "分数", "", "int", 10, 0, false)]
		public Int32 Score
		{
			get { return _Score; }
			set { if (OnPropertyChange("Score", value)) _Score = value; }
		}

		private String _Memo;
		/// <summary>
		/// 注释
		/// </summary>
		[Description("注释")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(14, "Memo", "注释", "", "nvarchar(200)", 0, 0, true)]
		public String Memo
		{
			get { return _Memo; }
			set { if (OnPropertyChange("Memo", value)) _Memo = value; }
		}

		private String _Prop1;
		/// <summary>
		/// 属性1
		/// </summary>
		[Description("属性1")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(15, "Prop1", "属性1", "", "nvarchar(200)", 0, 0, true)]
		public String Prop1
		{
			get { return _Prop1; }
			set { if (OnPropertyChange("Prop1", value)) _Prop1 = value; }
		}

		private String _Prop2;
		/// <summary>
		/// 属性2
		/// </summary>
		[Description("属性2")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(16, "Prop2", "属性2", "", "nvarchar(200)", 0, 0, true)]
		public String Prop2
		{
			get { return _Prop2; }
			set { if (OnPropertyChange("Prop2", value)) _Prop2 = value; }
		}

		private String _Prop3;
		/// <summary>
		/// 属性3
		/// </summary>
		[Description("属性3")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(17, "Prop3", "属性3", "", "nvarchar(200)", 0, 0, true)]
		public String Prop3
		{
			get { return _Prop3; }
			set { if (OnPropertyChange("Prop3", value)) _Prop3 = value; }
		}

		private String _Prop4;
		/// <summary>
		/// 属性4
		/// </summary>
		[Description("属性4")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(18, "Prop4", "属性4", "", "nvarchar(200)", 0, 0, true)]
		public String Prop4
		{
			get { return _Prop4; }
			set { if (OnPropertyChange("Prop4", value)) _Prop4 = value; }
		}

		private String _AddUser;
		/// <summary>
		/// 添加用户
		/// </summary>
		[Description("添加用户")]
		[DataObjectField(false, false, false, 200)]
		[BindColumn(19, "AddUser", "添加用户", "", "nvarchar(200)", 0, 0, true)]
		public String AddUser
		{
			get { return _AddUser; }
			set { if (OnPropertyChange("AddUser", value)) _AddUser = value; }
		}

		private DateTime _AddTime;
		/// <summary>
		/// 添加时间
		/// </summary>
		[Description("添加时间")]
		[DataObjectField(false, false, false, 7)]
		[BindColumn(20, "AddTime", "添加时间", "", "datetime2", 7, 0, false)]
		public DateTime AddTime
		{
			get { return _AddTime; }
			set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
		}

		private String _ModifyUser;
		/// <summary>
		/// 修改用户
		/// </summary>
		[Description("修改用户")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(21, "ModifyUser", "修改用户", "", "nvarchar(200)", 0, 0, true)]
		public String ModifyUser
		{
			get { return _ModifyUser; }
			set { if (OnPropertyChange("ModifyUser", value)) _ModifyUser = value; }
		}

		private DateTime _ModifyTime;
		/// <summary>
		/// 修改时间
		/// </summary>
		[Description("修改时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(22, "ModifyTime", "修改时间", "", "datetime2", 7, 0, false)]
		public DateTime ModifyTime
		{
			get { return _ModifyTime; }
			set { if (OnPropertyChange("ModifyTime", value)) _ModifyTime = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(23, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(24, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(25, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(26, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return _ID;
					case "OrderID" : return _OrderID;
					case "GoodsID" : return _GoodsID;
					case "SiteID" : return _SiteID;
					case "UserName" : return _UserName;
					case "SN" : return _SN;
					case "Name" : return _Name;
					case "Price" : return _Price;
					case "Discount" : return _Discount;
					case "DiscountPrice" : return _DiscountPrice;
					case "Count" : return _Count;
					case "Amount" : return _Amount;
					case "Score" : return _Score;
					case "Memo" : return _Memo;
					case "Prop1" : return _Prop1;
					case "Prop2" : return _Prop2;
					case "Prop3" : return _Prop3;
					case "Prop4" : return _Prop4;
					case "AddUser" : return _AddUser;
					case "AddTime" : return _AddTime;
					case "ModifyUser" : return _ModifyUser;
					case "ModifyTime" : return _ModifyTime;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "OrderID" : _OrderID = Convert.ToInt32(value); break;
					case "GoodsID" : _GoodsID = Convert.ToInt32(value); break;
					case "SiteID" : _SiteID = Convert.ToInt32(value); break;
					case "UserName" : _UserName = Convert.ToString(value); break;
					case "SN" : _SN = Convert.ToString(value); break;
					case "Name" : _Name = Convert.ToString(value); break;
					case "Price" : _Price = Convert.ToSingle(value); break;
					case "Discount" : _Discount = Convert.ToSingle(value); break;
					case "DiscountPrice" : _DiscountPrice = Convert.ToSingle(value); break;
					case "Count" : _Count = Convert.ToInt32(value); break;
					case "Amount" : _Amount = Convert.ToSingle(value); break;
					case "Score" : _Score = Convert.ToInt32(value); break;
					case "Memo" : _Memo = Convert.ToString(value); break;
					case "Prop1" : _Prop1 = Convert.ToString(value); break;
					case "Prop2" : _Prop2 = Convert.ToString(value); break;
					case "Prop3" : _Prop3 = Convert.ToString(value); break;
					case "Prop4" : _Prop4 = Convert.ToString(value); break;
					case "AddUser" : _AddUser = Convert.ToString(value); break;
					case "AddTime" : _AddTime = Convert.ToDateTime(value); break;
					case "ModifyUser" : _ModifyUser = Convert.ToString(value); break;
					case "ModifyTime" : _ModifyTime = Convert.ToDateTime(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得订单项字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 订单编号
			///</summary>
			public const String OrderID = "OrderID";

			///<summary>
			/// 商品编号
			///</summary>
			public const String GoodsID = "GoodsID";

			///<summary>
			/// 站点编号
			///</summary>
			public const String SiteID = "SiteID";

			///<summary>
			/// 用户名称
			///</summary>
			public const String UserName = "UserName";

			///<summary>
			/// 
			///</summary>
			public const String SN = "SN";

			///<summary>
			/// 名称
			///</summary>
			public const String Name = "Name";

			///<summary>
			/// 价格
			///</summary>
			public const String Price = "Price";

			///<summary>
			/// 
			///</summary>
			public const String Discount = "Discount";

			///<summary>
			/// 价格
			///</summary>
			public const String DiscountPrice = "DiscountPrice";

			///<summary>
			/// 数量
			///</summary>
			public const String Count = "Count";

			///<summary>
			/// 数量
			///</summary>
			public const String Amount = "Amount";

			///<summary>
			/// 分数
			///</summary>
			public const String Score = "Score";

			///<summary>
			/// 注释
			///</summary>
			public const String Memo = "Memo";

			///<summary>
			/// 属性1
			///</summary>
			public const String Prop1 = "Prop1";

			///<summary>
			/// 属性2
			///</summary>
			public const String Prop2 = "Prop2";

			///<summary>
			/// 属性3
			///</summary>
			public const String Prop3 = "Prop3";

			///<summary>
			/// 属性4
			///</summary>
			public const String Prop4 = "Prop4";

			///<summary>
			/// 添加用户
			///</summary>
			public const String AddUser = "AddUser";

			///<summary>
			/// 添加时间
			///</summary>
			public const String AddTime = "AddTime";

			///<summary>
			/// 修改用户
			///</summary>
			public const String ModifyUser = "ModifyUser";

			///<summary>
			/// 修改时间
			///</summary>
			public const String ModifyTime = "ModifyTime";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}